#!/usr/bin/env python
#coding=utf-8

import os
import json

cpu_count = os.popen("grep '^physical id' /proc/cpuinfo | sort | uniq | awk -F ': ' '{print $2}'")
cpus = []
for cpu in  cpu_count.readlines():
    r = os.path.basename(cpu.strip())
    cpus  += [{'{#CPUID}':r}]

print json.dumps({'data':cpus},sort_keys=True,indent=4,separators=(',',':'))
